"""
    均值滤波
        cv.blur(src, ksize, anchor, borderType)
            参数：src:输入的图像，ksize：卷积核的大小，anchor：默认值为（-1，-1），表示核中心，borderType：边界类型
"""
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt

# 1. 读取图像
dogsp = cv.imread("image/dogsp.jpeg")
doggau = cv.imread("image/dogGauss.jpeg")

# 2. 均值滤波
blur = cv.blur(dogsp, (5, 5))

# 3. 图像展示
plt.imshow(dogsp[:, :, ::-1])
plt.show()
plt.imshow(blur[:, :, ::-1])
plt.show()

# plt.figure(figsize=(10, 8), dpi=100)
# plt.subplot(121), plt.imshow(img[:, :, ::-1]), plt.title('原图')
# plt.xticks([]), plt.yticks([])
# plt.subplot(122), plt.imshow(blur[:, :, ::-1]), plt.title('均值滤波后结果')
# plt.xticks([]), plt.yticks([])
# plt.show()


